home *** CD-ROM | disk | FTP | other *** search
- MODULE 'dos/dos','dos/dostags','dos/dosextens','utility/tagitem'
-
- PROC main()
- -> pointer to the thread process
- DEF mythread:PTR TO Process
-
- -> create a thread process
- IF mythread:=CreateNewProc(
- [
- NP_Entry,&thread, -> where the thread process begins
- NP_Name,'MyThread', -> the thread process name
- TAG_DONE
- ])
-
- ENDIF
- Delay(50)
-
- -> IMPORTANT: the main process may never end when threads are running.
- -> In this small example, we simply wait a while, which is NOT RIGHT!!
- Delay(50)
-
- ENDPROC
-
- PROC thread()
-
- WriteF('Hello, it\as me, your newly created thread.\n')
- WriteF('I stopped now\n')
-
- ENDPROC
-